package me.znext.learn.android;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;

public class FeatureListActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_feature_list);

    this.setTitle("我的校园");
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    Button profileBtn = (Button) findViewById(R.id.profileBtn);
    assert profileBtn != null;
    profileBtn.setOnClickListener(new View.OnClickListener() {

      @Override
      public void onClick(View view) {
        gotoProfile();
      }
    });

    ListView leftMenu = (ListView) findViewById(R.id.leftMenuList);
    assert leftMenu != null;
  }

  private void gotoProfile() {
    Intent intent = new Intent();
    intent.setClass(FeatureListActivity.this, ProfileActivity.class);
    startActivity(intent);
  }
}
